package cn.myzqu.springcloud.eurekaclient.controller;

import cn.myzqu.springcloud.helloserviceapi.dto.User;
import cn.myzqu.springcloud.helloserviceapi.service.HelloService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RefactorHelloController implements HelloService {


    @Override
    public String hello(@RequestParam("name") String s) {
        return "Hello," + s;
    }

    @Override
    public User hello(@RequestHeader("name") String s, @RequestHeader("age") Integer integer) {
        return new User(s,integer);
    }

    @Override
    public String hello(@RequestBody User user) {
        return "Hello,"+user.getName()+","+user.getAge();
    }
}
